php add three zeros prefix

31

php add three zeros prefix -

<?php
$num = 4;
$num_padded = sprintf("%02d", $num);
echo $num_padded; // returns 04
?>

Comments

Submit
0 Comments